<f:view xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ice="http://www.icesoft.com/icefaces/component"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<ui:composition>
<style>
    .columnWidth150 {
        width: 150px;
    }

    .columnWidth300 {
        width: 300px;
    }

    .columnBlank {
    }

    .columnAlignCenter {
        text-align: center;
    }

    .ctltable {
        border-collapse: collapse;
        table-layout: fixed;
        width:100%;
    }

    .ctltable td {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        padding: 0px
    }
</style>
<ice:form>
    <ice:panelPopup draggable="false" modal="true" autoCentre="true"
                    rendered="#{bean.popupSelectCustomer.render }" style="height: 500px;width: 1090px">
        <f:facet name="header">
            <ice:panelGroup style="width: 1080px">
                <ice:outputText value="#{bean.popupSelectCustomer.title}"/>
                <ice:commandButton styleClass="popupHeaderImage" image="/images/popupclose.gif"
                                   title="Close Popup" alt="Close"
                                   action="#{bean.popupSelectCustomer.closeOrCancelPopup }"/>
            </ice:panelGroup>
        </f:facet>
        <f:facet name="body">
            <ice:panelGroup>
                <ice:panelGroup>
                    <ice:panelGrid columns="3" columnClasses="columnWidth150,columnWidth300,columnWidth150">
                        <ice:column>
                            <ice:panelGroup style="text-align: right">
                                <ice:outputText value="#{msgs['popup.customer.login.name']}"/><font
                                    color='red'>*</font>
                            </ice:panelGroup>
                        </ice:column>
                        <ice:column>
                            <ice:inputText value="#{bean.popupSelectCustomer.inputName}" style="width: 290px"
                                           valueChangeListener="#{bean.popupSelectCustomer.inputNameValueChangeListiener}"/>
                        </ice:column>
                        <ice:column>
                            <ice:commandButton value="#{msgs['common.button.search']}"
                                               actionListener="#{bean.popupSelectCustomer.search}"/>
                        </ice:column>
                    </ice:panelGrid>
                </ice:panelGroup>
                <ice:panelGroup style="height: 370px">
                    <ice:dataTable
                            id="dataSortData"
                            sortColumn="#{bean.popupSelectCustomer.sortedColumn}"
                            sortAscending="#{bean.popupSelectCustomer.ascending}"
                            value="#{bean.popupSelectCustomer.customerList}"
                            rows="15"
                            cellpadding="0" cellspacing="0"
                            styleClass="ctltable"
                            columnWidths="20px, 100px,200px, 280px, 100px,50px,50px,40px,50px,50px"
                            columnClasses="columnBlank,columnBlank,columnBlank,columnBlank,columnAlignCenter,columnAlignCenter,columnAlignCenter,columnAlignCenter,columnAlignCenter"
                            varStatus="index"
                            var="customer">
                        <ice:column>
                            <ice:rowSelector enhancedMultiple="false" value="#{customer.rowSelected}"
                                             selectionListener="#{bean.popupSelectCustomer.rowSelectedListiener}"/>
                            <ice:outputText value="#{index.index+1}"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="loginName" arrow="true">
                                    <ice:outputText value="#{msgs['popup.customer.login.name.title']}"/>
                                </ice:commandSortHeader>
                            </f:facet>
                            <ice:outputText value="#{customer.loginName}"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="firstName" arrow="true">
                                    <ice:outputText value="#{msgs['popup.customer.name']}"/>
                                </ice:commandSortHeader>
                            </f:facet>
                            <ice:outputText value="#{customer.firstName} #{customer.lastName}"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="orgName" arrow="true">
                                    <ice:outputText value="#{msgs['popup.customer.org.name']}"/>
                                </ice:commandSortHeader>
                            </f:facet>
                            <ice:outputText value="#{customer.orgName}"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <ice:commandSortHeader columnName="managerLoginName" arrow="true">
                                    <ice:outputText value="#{msgs['popup.customer.manager']}"/>
                                </ice:commandSortHeader>
                            </f:facet>
                            <ice:outputText value="#{customer.managerLoginName}"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <!--<ice:commandSortHeader columnName="hasCorporateAccount" arrow="true">-->
                                <ice:outputText value="#{msgs['popup.customer.has.corporate.account']}"/>
                                <!--</ice:commandSortHeader>-->
                            </f:facet>
                            <ice:selectBooleanCheckbox value="#{customer.hasCorporateAccount}" disabled="true"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <!--<ice:commandSortHeader columnName="hasCreditCard" arrow="true">-->
                                <ice:outputText value="#{msgs['popup.customer.has.credit.card']}"/>
                                <!--</ice:commandSortHeader>-->
                            </f:facet>
                            <ice:selectBooleanCheckbox value="#{customer.hasCreditCard}" disabled="true"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <!--<ice:commandSortHeader columnName="hasCheque" arrow="true">-->
                                <ice:outputText value="#{msgs['popup.customer.has.cheque']}"/>
                                <!--</ice:commandSortHeader>-->
                            </f:facet>
                            <ice:selectBooleanCheckbox value="#{customer.hasCheque}" disabled="true"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <!--<ice:commandSortHeader columnName="organization" arrow="true">-->
                                <ice:outputText value="#{msgs['popup.customer.is.org']}"/>
                                <!--</ice:commandSortHeader>-->
                            </f:facet>
                            <ice:selectBooleanCheckbox value="#{customer.organization}" disabled="true"/>
                        </ice:column>
                        <ice:column>
                            <f:facet name="header">
                                <!--<ice:commandSortHeader columnName="reseller" arrow="true">-->
                                <ice:outputText value="#{msgs['popup.customer.is.reseller']}"/>
                                <!--</ice:commandSortHeader>-->
                            </f:facet>
                            <ice:selectBooleanCheckbox value="#{customer.reseller}" disabled="true"/>
                        </ice:column>
                    </ice:dataTable>
                </ice:panelGroup>
                <ice:panelGroup>
                    <center><ice:dataPaginator rendered="#{bean.popupSelectCustomer.renderPaginator}"
                                               for="dataSortData" paginator="true" paginatorMaxPages="3"
                                               binding="#{bean.popupSelectCustomer.paginator}" fastStep="3">
                        <f:facet name="first">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-first.gif"/>
                        </f:facet>
                        <f:facet name="last">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-last.gif"/>
                        </f:facet>
                        <f:facet name="previous">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-previous.gif"/>
                        </f:facet>
                        <f:facet name="next">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-next.gif"/>
                        </f:facet>
                        <f:facet name="fastforward">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-ff.gif"/>
                        </f:facet>
                        <f:facet name="fastrewind">
                            <ice:graphicImage style="border:none;"
                                              url="./xmlhttp/css/xp/css-images/arrow-fr.gif"/>
                        </f:facet>
                    </ice:dataPaginator></center>
                </ice:panelGroup>
                <ice:panelGroup>
                    <center>
                        <ice:panelGrid columns="2"  columnClasses="columnWidth150,columnWidth150">
                            <ice:column>
                                <ice:panelGroup style="text-align: center">
                                    <ice:commandButton value="#{msgs['common.ok']}" action="#{bean.selectOk}" disabled="#{bean.popupSelectCustomer.disableOkButton}"/>
                                </ice:panelGroup>
                            </ice:column>
                            <ice:column>
                                <ice:panelGroup  style="text-align: center">
                                    <ice:commandButton value="#{msgs['common.close']}" action="#{bean.closeOrCancelPopup}"/>
                                </ice:panelGroup>
                            </ice:column>
                        </ice:panelGrid>
                    </center>
                </ice:panelGroup>
            </ice:panelGroup>
        </f:facet>
    </ice:panelPopup>
</ice:form>
</ui:composition>
</f:view>